#!/bin/bash

if [ "$2" == "pre-start" ]
then
    echo "gpu-fix-hookscript: Resetting GPU for Virtual Machine $1"
    echo 1 > /sys/bus/pci/devices/0000\:b3\:00.0/remove
    echo 1 > /sys/bus/pci/devices/0000\:b3\:00.1/remove
    echo 1 > /sys/bus/pci/rescan
fi
